Skip to content

feat: Custom-metadata, exists, info methods #1023

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Apr 27, 2025
Merged

Conversation

Vinzent03
Copy link
Collaborator

What kind of change does this PR introduce?

feature

What is the current behavior?

No support for specifying metadata for files when uploading and missing info and exists methods.

What is the new behavior?

Support specifying metadata when uploading files.

Additional context

close #1021
js pr

@Vinzent03
Copy link
Collaborator Author

Currently waiting for an answer on supabase/storage#541 because I'm unsure about the correct types of the FileObjectV2 class.

@Vinzent03 Vinzent03 changed the title feat: custom-metadata, exists, info methods feat: Custom-metadata, exists, info methods Sep 10, 2024
@coveralls
Copy link

coveralls commented Feb 4, 2025

Pull Request Test Coverage Report for Build 14534435626

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 48 of 50 (96.0%) changed or added relevant lines in 3 files are covered.
  • 84 unchanged lines in 10 files lost coverage.
  • Overall coverage increased (+1.7%) to 75.375%

Changes Missing Coverage Covered Lines Changed/Added Lines %
packages/storage_client/lib/src/fetch.dart 21 22 95.45%
packages/storage_client/lib/src/types.dart 14 15 93.33%
Files with Coverage Reduction New Missed Lines %
packages/gotrue/lib/src/broadcast_stub.dart 1 0.0%
packages/storage_client/lib/src/fetch.dart 1 94.06%
packages/realtime_client/lib/src/constants.dart 2 60.0%
packages/gotrue/lib/src/fetch.dart 4 92.59%
packages/supabase/lib/src/supabase_client.dart 7 68.42%
packages/gotrue/lib/src/gotrue_client.dart 8 64.85%
packages/yet_another_json_isolate/lib/src/_isolates_io.dart 11 79.03%
packages/realtime_client/lib/src/realtime_client.dart 12 88.78%
packages/gotrue/lib/src/types/auth_exception.dart 16 37.5%
packages/supabase_flutter/lib/src/supabase.dart 22 56.94%
Totals Coverage Status
Change from base Build 13051463855: 1.7%
Covered Lines: 2868
Relevant Lines: 3805

💛 - Coveralls

@@ -98,31 +108,15 @@ class Fetch {
filename: file.path,
contentType: contentType,
);
final request = http.MultipartRequest(method, Uri.parse(url))
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The deleted code here is the same as in _handleBinaryFileRequest() so I added additional _handleFileRequest() instead to reduce code duplication. These two can now use an actual _handleMultipartRequest() method, which just accepts a MultipartFile which is independent of a passed File or Uint8List.

@Vinzent03 Vinzent03 marked this pull request as ready for review April 18, 2025 11:56
@Vinzent03 Vinzent03 requested a review from dshukertjr April 18, 2025 11:56
@Vinzent03 Vinzent03 merged commit 4d3f4bf into main Apr 27, 2025
11 checks passed
@Vinzent03 Vinzent03 deleted the feat/custom-metadata branch April 27, 2025 15:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for custom metadata on storage objects missing
3 participants